@extends('layouts.tankuang')

@section('content')
    <!--startprint-->
    <form name="add_form" id="add_form" method="post" action="{{url('admin/units/edit',$id)}}" enctype="multipart/form-data">
        <input type="hidden" name="_token" value="{{ csrf_token() }}">
        <div id="div_print" style="margin-bottom: 40px;">
            <h2 class="text-center mg_b36 mg_t25">企事业单位基本情况登记表</h2>
            <table class="table-form table-border w mg-auto" style="width: 900px">
                <tbody>
                {{--@if($re->pic != '')
                    <tr>
                        <td class="font-bd" align="center" width="10%">单位图片</td>
                        <td colspan="5"><div class="example  col-md-12 col-xs-12 "><img src="{{ URL::asset('/') }}{{$re->pic}}" class="img-rounded" alt="" width="50"></div></td>
                    </tr>
                @endif--}}

                <tr>
                    <td class="font-bd" align="center" width="16%">单位名称</td>
                    <td colspan="2">
                        {{$re->name}}
                    </td>
                    <td rowspan="3" style="width: 190px;text-align: center;">
                        @if($re->pic != '')
                            <div class="example" style="width: 190px;display: inline-block;"><img src="{{ URL::asset('/') }}{{$re->pic}}" class="img-rounded" alt="" style="width: 190px;border-radius: 0;"></div>
                        @endif
                    </td>
                </tr>
                <tr>
                    <td class="font-bd" align="center">详细地址</td>
                    <td colspan="2">
                        {{$re->address}}
                    </td>
                </tr>
                <tr>
                    <td class="font-bd" align="center">辖区派出所</td>
                    <td colspan="2">
                        {{getValue($re->city,'area','id','name')}}{{getValue($re->area,'area','id','name')}}{{getValue($re->org_id,'area','id','name')}}
                    </td>
                </tr>
                <tr><td colspan="4" style="background-color: #69CEE9;text-align: center">单位信息</td></tr>
                <tr>
                    <td class="font-bd" align="center" width="16%">统一社会信用码</td>
                    <td width="34%">
                        {{$re->zuzhijigou}}
                    </td>
                    <td class="font-bd" align="center" width="16%">所属行业类别</td>
                    <td width="34%">
                        {{getValue($re->type,'unit_type','id','name')}}
                    </td>
                </tr>
                <tr>
                    <td class="font-bd" align="center">重点级别</td>
                    <td>
                        @if($re->is_imp == 0)一般单位
                        @elseif($re->is_imp == 1)省级重点单位
                        @elseif($re->is_imp == 2)市级重点单位
                        @elseif($re->is_imp == 3)县区级重点单位
                        @endif
                    </td>
                    <td class="font-bd" align="center">单位性质</td>
                    <td>
                        {{$re->xingzhi}}
                    </td>
                </tr>
                <tr>
                    <td class="font-bd" align="center">上级部门</td>
                    <td>
                        {{$re->shangjibumen}}
                    </td>
                    <td class="font-bd" align="center">单位状态</td>
                    <td>
                        @if($re->is_del == 0)实有
                        @elseif($re->is_del == 1)注销
                        @elseif($re->is_del == 2)合并
                        @endif
                    </td>
                </tr>
                <tr>
                    <td class="font-bd" align="center">固定资产（万元）</td>
                    <td>
                        {{$re->gdzc}}
                    </td>
                    <td class="font-bd" align="center">要害部门部位数量</td>
                    <td>
                        {{$count['buwei_num']}}
                    </td>
                </tr>
                <tr><td colspan="4" style="background-color: #69CEE9;text-align: center">人员信息</td></tr>
                <tr>
                    <td class="font-bd" align="center">在职职工总数</td>
                    <td>
                        {{$re->zaizhi_num_of_peo}}
                    </td>
                    <td class="font-bd" align="center">在职保安人数</td>
                    <td>
                        {{$count['zaizhi_num']}}
                    </td>
                </tr>
                <tr>
                    <td class="font-bd" align="center">自招保安人数</td>
                    <td>
                        {{$count['zizhao_num']}}
                    </td>
                    <td class="font-bd" align="center">外聘保安人数</td>
                    <td>
                        {{$count['waipin_num']}}
                    </td>
                </tr>
                <tr>
                    <td class="font-bd" align="center">重点岗位人数</td>
                    <td>
                        {{$count['zdgw_num']}}
                    </td>
                    <td class="font-bd" align="center">维稳对象人数</td>
                    <td>
                        {{$re->zdwwgzdx_num_of_peo}}
                    </td>
                </tr>
                <tr>
                    <td class="font-bd" align="center">单位法人</td>
                    <td>
                        {{$re->frdb_name}}
                    </td>
                    <td class="font-bd" align="center">联系电话</td>
                    <td>
                        {{$re->frdb_phone}}
                    </td>
                </tr>
                <tr>
                    <td class="font-bd" align="center">保卫负责人</td>
                    <td>
                        {{$re->bwfzr_name}}
                    </td>
                    <td class="font-bd" align="center">联系电话</td>
                    <td>
                        {{$re->bwfzr_phone}}
                    </td>
                </tr>
                <tr>
                    <td class="font-bd" align="center">责任民警</td>
                    <td>
                        {{getValue($re->minjing,'admin_users','id','name')}}
                    </td>
                    <td class="font-bd" align="center">联系电话</td>
                    <td>
                        {{$re->minjing_phone}}
                    </td>
                </tr>
                <tr><td colspan="4" style="background-color: #69CEE9;text-align: center">GIS信息</td></tr>
                <tr>
                    <td class="font-bd" align="center">经度</td>
                    <td>
                        {{$re->jd}}
                    </td>
                    <td class="font-bd" align="center">纬度</td>
                    <td>
                        {{$re->wd}}
                    </td>
                </tr>
                <tr><td colspan="4" style="background-color: #69CEE9;text-align: center">行业信息</td></tr>
                @foreach($field as $vv)
                    <tr>
                        @foreach($vv as $v)
                            <td class="font-bd" align="center">{{$v->field_content}}</td>
                            <td>
                                {{getFieldValue($re->id,$re->type,$v->id)}}
                            </td>
                        @endforeach
                    </tr>
                @endforeach
                <tr>
                    <td class="font-bd" align="center">备注</td>
                    <td colspan="3">
                        {{$re->remark}}
                    </td>
                </tr>
                </tbody>
            </table>
            <!--endprint-->
            <div class="wbt mg_t25 pd_b20 text-center">
                <a id="goToPageB" class="easyui-linkbutton dsp print" data-options="iconCls:'icon-print'" onclick="doPrint()">打印</a>
            </div>
        </div>
    </form>

    <link rel="stylesheet" href="{{ URL::asset('/') }}css/zoomify.min.css">
    <script src="{{ URL::asset('/') }}js/zoomify.min.js"></script>
    <script type="text/javascript">
        $('.example img').zoomify(function(){
            $(this).css({'position':'absolute','top':0,'bottom':0,'left':0,'right':0,'z-index':'9999',})
        });
    </script>
    <script type="text/javascript">
        function doPrint() {
            bdhtml=window.document.body.innerHTML;
             sprnstr="<!--startprint-->";
             eprnstr="<!--endprint-->";
             prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);
             prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));
             window.document.body.innerHTML=prnhtml;
             window.print();
        }
    </script>
@stop